var sendConfig = function(){
    return{
        mailEdit: function () {
            $.post('/system/sendDetail', function (result) {
                console.info(result["rows"][0]["From"])
                if (result != null) {
                    $("#CmpName1").val(result["rows"][0]["Cmpname"]);
                    $("#CmpTel1").val(result["rows"][0]["Cmptel"]);
                    $("#CmpMail1").val(result["rows"][0]["Cmpmail"]);
                    $("#SendTime1").datebox('setValue', result["rows"][0]["Sendtime"]);
                    $("#ErrTimes1").val(result["rows"][0]["Errtimes"]);
                }
            }, 'json');
            $('#w').window('open');
        },

        //关闭弹出框
        closePopu: function () {
            $('#w').window('close');
        },
        //保存修改完操作
        save: function () {
            var CmpName= $("#CmpName1").val();
            var CmpTel= $("#CmpTel1").val();
            var CmpMail= $("#CmpMail1").val();
            var SendTime = $("#SendTime1").datetimebox('getValue');
            //var SendTime= $("#SendTime1").val();
            var ErrTimes= $("#ErrTimes1").val();
            var parmas={Cmpname:CmpName,Cmptel:CmpTel,Cmpmail:CmpMail,Sendtime:SendTime,Errtimes:ErrTimes}
            $.ajax({
                type: 'POST',
                url: '/system/sendEdit',
                dataType: 'json',
                data: parmas,
                success: function (result) {
                    if (result['info'] == 'Success') {
                        alert("修改发送配置成功！")
                        sendConfig.closePopu();
                        window.location.reload();
                    } else {
                        alert("修改发送配置失败！")
                    }
                }
            })

        },

    }

}
();
